﻿<!--タイムライン表示部分のView-->
	
<UserControl x:Class="WTwitter.View.TimelineView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:compModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
	xmlns:view="clr-namespace:WTwitter.View"
	xmlns:vm="clr-namespace:WTwitter.ViewModel"
	xmlns:util="clr-namespace:WTwitter.ViewModel.Utility">
	<UserControl.Resources>
		
		<!--絞り込みComboBoxのアイテムのStyle-->
		<DataTemplate DataType="{x:Type vm:UserViewModel}">
			<StackPanel Orientation="Horizontal">
				<Image Source="{Binding Path=ProfileImageUrl}" Width="16" Height="16"/>
				<TextBlock Text="{Binding Path=ScreenName}"/>
			</StackPanel>
		</DataTemplate>
		
		<!--絞り込みComboBoxのGroupヘッダのStyle-->
		<DataTemplate x:Key="ComboBoxGroupStyle">
			<StackPanel>
				<TextBlock Text="{Binding Path=Name}"/>
			</StackPanel>
		</DataTemplate>
		
		<!--コマンド-->
		<RoutedCommand x:Key="MoveToTopItemCommand"/>
	
		<Style x:Key="{x:Type Image}" TargetType="{x:Type Image}">
			<Setter Property="Height" Value="24"/>
			<Setter Property="Width" Value="24"/>
		</Style>
	</UserControl.Resources>

	<UserControl.CommandBindings>
		<CommandBinding Command="{StaticResource MoveToTopItemCommand}" Executed="MoveToTopItemExecuted"/>
	</UserControl.CommandBindings>
	
	<DockPanel>
		<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">

			<Button Command="{Binding Path=ShowSubmitPanelCommand}" Style="{DynamicResource ImageButtonStyle}">
				<Image Source="{DynamicResource SubmitImage}"/>
				<Button.ToolTip>投稿</Button.ToolTip>
			</Button>
			
			<Button Command="{StaticResource MoveToTopItemCommand}" Style="{DynamicResource ImageButtonStyle}">
				<Image Source="{DynamicResource UpToViewTopImage}"/>
				<Button.ToolTip>一番上へスクロール</Button.ToolTip>
			</Button>
			
			<Button Command="{Binding Path=RefleshCommand}" Style="{DynamicResource ImageButtonStyle}">
				<Image Source="{DynamicResource RefleshTimelineImage}"/>
				<Button.ToolTip>タイムラインを更新</Button.ToolTip>
			</Button>
			
			<ComboBox ItemsSource="{Binding Path=AllUsersViewSource.View}"
					  SelectedItem="{Binding Path=SelectedFilterUser, Mode=TwoWay}"
					  MinWidth="70" ToolTip="ユーザーで絞り込み" Style="{DynamicResource DesignedComboBoxStyle}">
				<ComboBox.GroupStyle>
					<GroupStyle HeaderTemplate="{StaticResource ComboBoxGroupStyle}"/>
				</ComboBox.GroupStyle>
			</ComboBox>
			<TextBox Text="{Binding Path=SearchKeyword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
					 MinWidth="70" ToolTip="キーワードで絞り込み" Style="{DynamicResource DesignedSubTransparentTextBoxStyle}"/>

			<Button Command="{Binding Path=ClearFilterCommand}" Style="{DynamicResource ImageButtonStyle}">
				<Image Source="{DynamicResource ClearFilterImage}"/>
				<Button.ToolTip>絞り込みをクリア</Button.ToolTip>
			</Button>
		</StackPanel>
		
		<view:TimelineContentsView x:Name="_timelineContentsView" DataContext="{Binding}"/>

	</DockPanel>
</UserControl>
